package com.yunke.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yunke.entity.YunkeScheduleJob;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 定时任务Mapper接口
 * 
 * @author yunke
 * @since 1.0.0
 */
@Mapper
public interface YunkeScheduleJobMapper extends BaseMapper<YunkeScheduleJob> {

    /**
     * 分页查询任务列表
     */
    IPage<YunkeScheduleJob> selectJobPage(Page<YunkeScheduleJob> page,
                                         @Param("jobName") String jobName,
                                         @Param("jobGroup") String jobGroup,
                                         @Param("jobStatus") Integer jobStatus);

    /**
     * 更新任务状态
     */
    int updateJobStatus(@Param("id") Long id,
                       @Param("jobStatus") Integer jobStatus);

    /**
     * 更新任务执行统计
     */
    int updateExecuteStats(@Param("id") Long id,
                          @Param("executeCount") Integer executeCount,
                          @Param("successCount") Integer successCount,
                          @Param("failCount") Integer failCount,
                          @Param("lastExecuteTime") Long lastExecuteTime);
} 